#!/usr/bin/env python
# encoding: utf-8

from threading import Thread



def run(*dbs, **kws):
    print dbs, ">>>>>"
    for db,tb in dbs:
        import subprocess
        retcode = subprocess.call(["cmd",])


threads = [Thread(target=run,args=(("db1","tb1"),)), 
            Thread(target=run,args=(("db1","tb1"),))]

if __name__ == "__main__":
    for t in threads: t.start()
    for t in threads: t.join()